<template>
  <a-card :bordered="false">
    <super-query :fieldList="tableObj.columns" @ok="handleSuperQuery"/>
    <v-table
      ref="table"
      :data="loadData"
      :columns="tableObj.columns"
    >
<!--      <template v-slot:buttons>-->
<!--        <a-button @click="$refs.lineForm.init('','add')" icon="plus" type="primary">增加产线</a-button>-->
<!--      </template>-->
<!--      <span slot="action" slot-scope="{ row,text }">-->
<!--        <span>-->
<!--          <a href="javascript:;" @click="edit(row)">编辑</a>-->
<!--          <a-divider type="vertical" />-->
<!--        </span>-->
<!--      </span>-->
    </v-table>
  </a-card>
</template>

<script>
import { fetchList } from '@/api/side/warehouse'
import { TableMixin } from '@/mixins/TableMixin'
import SuperQuery from '@comp/SuperQuery/SuperQuery'
import { tableObj } from './template'
export default {
  name: 'PlanDay',
  mixins: [TableMixin],
  components: {
    SuperQuery
  },
  data () {
    return {
      tableObj,
      dataSource: [],
      loadData: parameter => {
        return fetchList(
          Object.assign(parameter, this.queryParam)
        ).then(res => {
          return res.data
        })
      }
    }
  },
  methods: {
    // edit (record) {
    //   this.$refs.lineForm.init(record.lineCode, 'edit')
    // },
    handleSuperQuery (params) {
      console.log(params,'params')
      if(params){
        this.queryParam.queryType = params.queryType
        this.queryParam.queryItems = encodeURI(JSON.stringify(params.queryItems))
      }else{
        this.queryParam.queryType = ''
        this.queryParam.queryItems = ''
      }
      this.queryPage()
    }
  }
}
</script>

<style scoped>

</style>
